export const dateFormat = (timestamp,state = 1000) => {
    timestamp = Number(timestamp)*state
    if (timestamp){
        const date = new Date(timestamp)
        const year = date.getFullYear()
        const month = (date.getMonth() + 1).toString().padStart(2, '0')
        const day = date.getDate().toString().padStart(2, '0')
        const hours = ('0' + date.getHours()).slice(-2);
        const minutes = ('0' + date.getMinutes()).slice(-2);
        const seconds = ('0' + date.getSeconds()).slice(-2);
        return `${year}/${month}/${day} ${hours}:${minutes}:${seconds}`
    }else{
        return ''
    }
    
}